<template>
	<view class="com-empty y-flex y-align-center y-justify-center">
		<image :style="{width: pixelunit(width)}" :src="image" mode="widthFix" v-if="image"></image>
		<text class="mt-15 text-align-center" v-if="text" :style="{color: color, 'font-size': pixelunit(size)}">{{text}}</text>
	</view>
</template>

<script>
	export default {
		props: {
			text: {
				type: String,
				default: ''
			},
			color: {
				type: String,
				default: '#8A96A3'
			},
			size: {
				type: [String,Number],
				default: 35
			},
			width: {
				type: [String,Number],
				default: '450'
			},
			image: {
				type: String,
				default: ''
			}
		},
		methods: {
			pixelunit (size) {
				const text = size.toString()
				return text.indexOf('px') > -1 ? text : text + 'rpx'
			}
		}
	}
</script>

<style>
</style>
